	<?php $form = $this->beginWidget('CActiveForm', array(
				'id'			=> 'book-form',
				'htmlOptions'	=> array('enctype'=>'multipart/form-data'),
			)); ?>
			<p>
				<label>小说标题：</label>
				<?php echo $form->textField($model, 'book_title', array('class'=>'text-input small-input')); ?>
			</p>
			<p>
				<label>小说作者：</label>
				<?php echo $form->textField($model, 'book_author', array('class'=>'text-input')); ?>
			</p>
			<p>
				<label>小说封面图：</label>
				<?php if(!empty($model->book_image)): ?>
				<?php echo CHtml::image(Yii::app()->request->baseUrl.'/uploads/bookImages/'.$model->book_image, $model->book_image, array('width'=>'111','height'=>'161')); ?>
				<br />
				<?php endif; ?>
				<?php echo $form->fileField($model, 'book_image', array('class'=>'text-input small-input')); ?>
			</p>
			<p>
				<label>小说投票数：</label>
				<?php echo $form->textField($model, 'book_vote', array('class'=>'text-input')); ?>
			</p>
			<p>
				<label>小说总字数：</label>
				<?php echo $form->textField($model, 'book_length', array('class'=>'text-input')); ?>
			</p>
			<p>
				<label>小说状态：</label>
				<?php echo $form->radioButtonList($model, 'book_status', array('0'=>'未完结', '1'=>'已完结'), array('separator'=>'', 'container'=>'', 'onclick'=>'finishTime(this)', 'labelOptions'=>array('style'=>'font-weight:normal;padding:0;display:inline;'))); ?>
			</p>
			<p id="book_finish_time" <?php if(!$model->isNewRecord): ?><?php if($model->book_status == 0): ?>style="display: none"<?php endif; ?><?php endif; ?>>
				<label>小说完结时间：</label>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
								'model'				=> $model,
								'attribute'			=> 'book_finish_time',
								'language'			=> 'cn',
								'options'			=> array('dateFormat'=>'yy-mm-dd'),
								'htmlOptions'	=> array('class'=>'text-input'),		
				)); ?>
			</p>
			<p>
				<label>小说链接地址：</label>
				<?php echo $form->textField($model, 'book_url', array('class'=>'text-input small-input')); ?>
			</p>
			<p>
				<label>小说类别：</label>
				<?php echo $form->dropDownList($model, 'book_category', Category::getCategorySelect(Category::getCategoryTree(0)),array('class'=>'small-input')); ?>
			</p>
			<p>
				<label>小说简介：</label>
				<?php echo $form->textArea($model, 'book_desc', array('class'=>'xheditor-mini {skin:"nostyle",forcePtag:false}','rows'=>12,'cols'=>80,'stlye'=>'width: 80%')); ?>
			</p>
			<p>
				<?php echo CHtml::submitButton('提交', array('class'=>'button')); ?>
				<?php echo $model->isNewRecord?'':CHtml::button('返回', array('class'=>'button', 'onclick'=>'history.back()')); ?>
			</p>
			<?php $this->endWidget(); ?>
<script>
	function finishTime(obj)
	{
		if($(obj).val() == 1)
		{
			changeParentHeight(70);
			$("#book_finish_time").slideDown('fast');
		}else{
			changeParentHeight(-70);
			$("#book_finish_time").slideUp('fast');
		}	
	}
	function changeParentHeight(h)
	{
		parent.document.getElementById("main").style.height = (parent.frames["main"].document.body.scrollHeight+h)+"px";
	}
</script>